package com.xj.qq;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.util.Log;
import android.view.ContextMenu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;


import com.xj.qq.adapters.UsersAdapters;
import com.xj.qq.domain.SQLuser;


public class Back extends AppCompatActivity {

    private Button show;
    private Button back;
    private Button person;
    private ListView mListView;
    private Cursor cursor;
    private UsersAdapters usersAdapters;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.setting_layout);
        mListView = (ListView) findViewById(R.id.listView1);
        cursor = SQLuser.getInstance(getApplicationContext()).select(null, null);
        usersAdapters = new UsersAdapters(getApplicationContext(), cursor);
        this.mListView.setAdapter(usersAdapters);
        back = (Button) findViewById(R.id.backlogin);
        person = (Button) findViewById(R.id.backperson);
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(Back.this, QQLogin.class);
                startActivity(intent);
                finish();
            }
        });

        person.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(Back.this, MainActivity.class);
                String str = intent.getStringExtra("user_N");
                intent.putExtra("username", str);
                startActivity(intent);
                finish();
            }
        });
    }
}

